package com.baturu.vin.gm.dto;

import com.baturu.vin.base.dto.BaseVinAnalyseResultDTO;
import com.baturu.vin.dto.superEPC.SEPCCarTypeDetailDTO;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Sets;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;

import java.util.Arrays;
import java.util.List;
import java.util.Set;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GMVinModelDTO extends BaseVinAnalyseResultDTO {

    private Integer id;
    private String btrId;
    private String vinCode;
    private String catalog;
    private String body;
    private String series;
    private String year;
    private String optionCode;
    private String excludeOptions;
    private Long offlineDate;
    private String brand;
    private String group;
    private String engine;
    private String engineDesc;
    private String transmission;
    private String transmissionDesc;
    private String displacement;
    private String catalogCN;
    private List<SEPCCarTypeDetailDTO> optionDesc;
    private HashMultimap<String,String> vinOptionFamily;
    private Set<String> pass = Sets.newHashSet();
    private Set<String> alternative = Sets.newHashSet();
    private List<GmVinVdsDTO> gmVdsDtos;


    public String getBrandName() {
        if (StringUtils.equals(brand, "1")) {
            return "别克";
        }
        if (StringUtils.equals(brand, "2")) {
            return "凯迪拉克";
        }
        if (StringUtils.equals(brand, "3")) {
            return "雪佛兰";
        }
        return "";
    }

    public List<String> getOptionCodeList() {
        return Arrays.asList(getOptionCode().split(","));
    }
}
